package com.rocketmq.controller;

import com.rocketmq.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("order")
public class OrderController {

    @Autowired
    private IOrderService orderService;

    /**
     * 获取订单信息
     *
     * @param userId
     * @return
     */
    @GetMapping("getOrderInfo")
    public String getOrderInfo(int userId) {
        return orderService.getOrderInfo(userId);
    }


    /**
     * 订单支付
     *
     * @param orderId
     * @return
     */
    @RequestMapping("pay")
    public String pay(int orderId) {
        return orderService.pay(orderId);
    }


}
